<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../static/js/jquery-3.4.1.js"></script>
</head>
<script>
    function  sendmail() {
        var userinfomail=$('input[name="userinfomail"]').val();
        alert(userinfomail);
        if(userinfomail != null) {
            $.ajax({
                url : "/sendmail",
                type : "get",
                data : {"userinfomail":userinfomail},
                dataType : "json",
                async : true,
                success : function(data) {
                    if (data.errcode == 'success') {
                        alert("邮箱验证码已发送请查出,1分钟过期");
                    } else {
                        alert(data);
                    }
                }
            });
        } else {
            alert("验证码不能为空");
        }
    }
</script>
<body>
    》》》》当前位置：登录页
    <form action="/login" method="post">
        用户名：<input value="" name="userinfoName" type="text" placeholder="请输入用户名"><br>
        密  码：<input value="" name="userinfoPassword" type="password" placeholder="请输入密码"><br>
        邮  箱：<input value="" name="userinfomail" type="text" placeholder="请输入邮箱"> <input type="button" value="发送" onclick="sendmail()"><br>
        验证码：<input value="" name="verificationCode" type="text" placeholder="请输入验证码"><br>
        <input type="submit" value="确定">
    </form>

</body>
</html>